<?php 
$link = mysql_connect('localhost', 'root', '');
if(!$link)
{
	die('Not connected : ' . mysql_error());
}
$db = mysql_select_db('games');
if(!$db)
{
	die('No db : ' . mysql_error());
}

$email = isset($_REQUEST['email']) ? $_REQUEST['email'] : '';
$identifier = isset($_COOKIE['identifier']) ? $_COOKIE['identifier'] : '';


if($email != '')
{

$query = sprintf("DELETE FROM users where Identifier = '%s' and Email = '%s'", $identifier, $email);

$result = mysql_query($query);

ob_start();
header( 'Location: logout.php');
}
else
{
	ob_start();

header( 'Location: profile.php');
}
?>